import { View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { Badge, Image } from "@taroify/core";
import { imgAddPrefix } from "@/utils";

interface BarCardProps {
  // 用户头像
  sectorUrl: string;
  kid: string;
  sectorName: string;
  size?: number;
  starCount?: number | string;
}

export default ({
  sectorUrl,
  kid,
  sectorName,
  size = 50,
  starCount,
}: BarCardProps) => {
  return (
    <View
      onClick={() => Taro.navigateTo({ url: "/pages/bar/info?id=" + kid })}
      className="flex gap-2 items-center"
    >
      <Image
        className="rounded-xl"
        style={{ width: size, height: size }}
        src={imgAddPrefix(sectorUrl)}
      />
      <View>
        <View className="font-semibold text-sm">{sectorName}</View>
        <View className="text-gray-400 text-xs">热度：{starCount}</View>
      </View>
    </View>
  );
};
